<form [formGroup]="heroForm" (ngSubmit)="onSubmit()">
  <div class="field">
    <label for="name">Name</label>
    <input id="name" name="name" type="text" formControlName="name" required>
    <div *ngIf="formErrors.name">{{formErrors.name}}</div>
  </div>
</form>